/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package InternetHax;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
 * @author LoginError
 */
public class GameMidlet extends MIDlet {

    Display display;
    
    public void startApp() {
        
        try
        {
        HaxCanvas canvas = new HaxCanvas();
        canvas.init();
        
        display = Display.getDisplay(this);
        display.setCurrent(canvas);
        
        canvas.startGame();
        Gamestate.midlet = this;
        }
        catch(Exception errors)
        {
            Alert alert = new Alert("Fatal Error");
            errors.printStackTrace();
            alert.setString(errors.toString());
            alert.setTimeout(2000);
            display.setCurrent(alert);
        }
    }

    
    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
        this.notifyDestroyed();
    }
}
